home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 July / EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso / earcd / biz / dbase / ax.lha / Ax / Install_Ax < prev    next >
Text File  |  1997-03-15  |  13KB  |  348 lines

  1. ; Install-Script for Ax 1.0
  2.  
  3. ; ---------------------------------------------------------------------------
  4.  
  5. ; ************* PLEASE COPY THIS PROCEDURE ALONG WITH THE STRINGS IT USES
  6. ; ************* TO THE INSTALLER SCRIPT OF YOUR CLASSACT APPLICATION.
  7. ; ************* IT WILL TAKE CARE OF INSTALLING THE CLASSACT CLASSES YOU
  8. ; ************* PROVIDED WITH YOUR APPLICATION TO THE USER'S SYSTEM.
  9.  
  10. ; ClassAct installation procedure V 1.5 (12.5.96) by Osma Ahvenlampi
  11.  
  12. ; percentage of the size of included ClassAct classes versus the whole
  13. ; distribution (ie. total "complete" percentage after ClassAct is installed)
  14. (set classact-complete 90)
  15.  
  16. ; ClassAct installer scripts
  17. (set #classdest-prompt "Please select the directory where you want the ClassAct classes installed.\n(See help for details)")
  18. (set #classdest-help (cat "ClassAct is a GUI toolkit consisting of shared BOOPSI classes.\n\nSome programs require some or all of the ClassAct classes installed on your system. "
  19.     (if v39 (cat "OS 3.0 has a standard directory for BOOPSI classes, the SYS:Classes directory. It is recommended that you install ClassAct there.")
  20.             (cat "OS 2.0 does not have a standard place for disk resident BOOPSI classes. On OS 3.0 these classes are stored in the SYS:Classes directory. It is recommended that you create this directory and install ClassAct there.\nThis directory must be added in the LIBS: assign. This can be done by placing the command\nAssign >NIL: LIBS: SYS:Classes ADD\nto User-Startup. This installer will do this for you.")
  21.         )
  22.     )
  23. )
  24. (set #classes-020 "Do you want to use the OS 3.0, 020 optimised version of ClassAct?")
  25. (set #help-020 "Some ClassAct libraries have versions optimised for use on 020 or better equipped OS 3.0 or later machines. If your Amiga is such equipped, you should install these. The 68000/2.0 versions will also work, but are slightly slower.")
  26. (set #noclasses-message "The directory you selected for your ClassAct classes is not a part of the LIBS: assign.\n\nIt is necessary to add this assign so that the classes will be found properly.")
  27. (set #creating-dir "Creating directory ")
  28. (set #usbackup-prompt "User-Startup will now be backed up.")
  29. (set #usbackup-help "This installer will next make a modification in User-Startup. Before doing this the old User-Startup will be backed up to S:User-Startup.old")
  30. (set #adding-1 "Adding ")
  31. (set #adding-2 " to LIBS: assign\n")
  32. (set #adding-help "This is necessary so that the custom classes can be found.")
  33. (set #junod-button "It seems you have a late Commodore 'V42' button.gadget installed on your system.\n\nClassAct's button.gadget is far more capable than this gadget, and we recommend that you replace it. The ClassAct button.gadget is backwards compatible to the Commodore gadget. Do you wish to back up the Commodore gadget and replace it with the ClassAct version?")
  34. (set #junod-backed "The Commodore 'V42' button.gadget has been backed up with the name button.gadget.v42.\n\nThe ClassAct button.gadget will be installed in its place.")
  35. (set #junod-kept "The Commodore 'V42' button.gadget was not replaced with the more capable ClassAct version.\n\nPrograms depending on the availability of ClassAct-only features will be likely to work wrong.")
  36. (set #caprefs-message "CAPrefs is a small utility that sets some user preferences for ClassAct applications. These include the bevel style (Thin/Gadtools/Xen), window backfills, and group label details.\n\nPlease use the ClassAct GUI prefs editor to alter the default settings provided. ClassAct prefs will be installed in your system Prefs drawer.\n\n")
  37. (set #caprefs-startup-1 "Adding the command\n\n")
  38. (set #caprefs-startup-2 "\n\nTo your s:User-Startup.")
  39.  
  40. (procedure install-classact
  41. ; call this procedure to copy the classes included in the Classes directory
  42. ; in your distribution dir.
  43.      (if (exists "Classes") ; The archive contains a ClassAct library update.
  44.      (
  45.           (set comp-dest  (/ (* classact-complete 2) 10))
  46.           (set comp-libs  (/ (* classact-complete 3) 10))
  47.           (set comp-dirs  (/ (* classact-complete 4) 10))
  48.           (set comp-junod (/ (* classact-complete 5) 10))
  49.           (set comp-020   (/ (* classact-complete 6) 10))
  50.           (set comp-gad   (/ (* classact-complete 7) 10))
  51.           (set comp-im    (/ (* classact-complete 8) 10))
  52.           (set comp-prefs (/ (* classact-complete 9) 10))
  53.  
  54.           ; has the user installed ClassAct in CLASSACT: ?
  55.           (set @classact-dest (getassign "CLASSACT" "A"))
  56.           (if (= @classact-dest "") (set @classact-dest "SYS:Classes"))
  57.  
  58.           ; is ClassAct already in SYS:Classes ?
  59.           (if (or (not (exists (tackon @classact-dest "Gadgets/layout.gadget") (noreq)))
  60.                   (= @user-level 2))
  61.               ; no, ask where it should be placed
  62.               (set @classact-dest
  63.                   (askdir
  64.                       (prompt #classdest-prompt)
  65.                       (help #classdest-help)
  66.                       (default @classact-dest)
  67.                       (newpath)
  68.                   )
  69.               )
  70.           )
  71.  
  72.           (complete comp-dest)
  73.  
  74.           (if (<> (run (cat "C/CheckAssign LIBS: " @classact-dest)) 0)
  75.               (
  76.                   (message #noclasses-message)
  77.                   (if (not (exists @classact-dest))
  78.                        (makedir @classact-dest (prompt (cat #creating-dir @classact-dest)))
  79.                    )
  80.                   (set @addassign (cat "Assign >NIL: LIBS: " @classact-dest " ADD\n"))
  81.                   (startup "CLASSACT"
  82.                     (command @addassign)
  83.                       (prompt (cat #adding-1 @classact-dest #adding-2))
  84.                       (help #adding-help)
  85.                   )
  86.                   (run (@addassign))
  87.               )
  88.           )
  89.  
  90.           (complete comp-libs)
  91.  
  92.           (set @classact-gadgets (tackon @classact-dest "Gadgets"))
  93.           (set @classact-images (tackon @classact-dest "Images"))
  94.  
  95.           (if (not (exists @classact-gadgets (noreq)))
  96.               (makedir @classact-images
  97.                   (prompt (cat #creating-dir @classact-gadgets))
  98.               )
  99.           )
  100.  
  101.           (if (not (exists @classact-images (noreq)))
  102.               (makedir @classact-images
  103.                   (prompt (cat #creating-dir @classact-images))
  104.               )
  105.           )
  106.  
  107.           (complete comp-dirs)
  108.  
  109.           (if (exists "SYS:Classes/Gadgets/button.gadget")
  110.               (if (< 41 (/ (getversion "SYS:Classes/Gadgets/button.gadget") 65536))
  111.                   (if (askbool (prompt #junod-button) (help @askbool-help) (default 1))
  112.                       (
  113.                           (rename "SYS:Classes/Gadgets/button.gadget" "SYS:Classes/Gadgets/button.gadget.v42")
  114.                           (message #junod-backed)
  115.                       )
  116.                       (message #junod-kept)
  117.                   )
  118.               )
  119.           )
  120.  
  121.           (complete comp-junod)
  122.  
  123.           (if (exists "Classes/Gadgets/layout.gadget.020")
  124.                (set classes-020 (askbool (prompt #classes-020) (help #help-020) (default (and cpu020 v39))))
  125.                (set classes-020 0)
  126.           )
  127.  
  128.           (complete comp-020)
  129.  
  130.           (foreach "Classes/Gadgets" "#?.gadget"
  131.                (
  132.                     (set thislib (tackon "Classes/Gadgets" @each-name))
  133.                     (if (and classes-020 (exists (cat thislib ".020")))
  134.                          (set thislib (cat thislib ".020"))
  135.                     )
  136.                    (copylib (source thislib)
  137.                        (dest @classact-gadgets)
  138.                        (newname @each-name)
  139.                        (prompt (cat #installing @each-name))
  140.                        (help #classdest-help)
  141.                        (optional "force" "askuser")
  142.                    )
  143.               )
  144.           )
  145.  
  146.           (complete comp-gad)
  147.  
  148.           (foreach "Classes/Images" "#?.image"
  149.                (
  150.                     (set thislib (tackon "Classes/Images" @each-name))
  151.                     (if (and classes-020 (exists (cat thislib ".020")))
  152.                          (set thislib (cat thislib ".020"))
  153.                     )
  154.                    (copylib (source thislib)
  155.                        (dest @classact-images)
  156.                        (newname @each-name)
  157.                        (prompt (cat #installing @each-name))
  158.                        (help #classdest-help)
  159.                        (optional "force" "askuser")
  160.                    )
  161.               )
  162.           )
  163.  
  164.           (complete comp-im)
  165.  
  166.           (foreach "Classes" "#?.class"
  167.                (
  168.                     (set thislib (tackon "Classes" @each-name))
  169.                     (if (and classes-020 (exists (cat thislib ".020")))
  170.                          (set thislib (cat thislib ".020"))
  171.                     )
  172.                    (copylib (source thislib)
  173.                        (dest @classact-dest)
  174.                        (newname @each-name)
  175.                        (prompt (cat #installing @each-name))
  176.                        (help #classdest-help)
  177.                        (optional "force" "askuser")
  178.                    )
  179.               )
  180.           )
  181.      )
  182.      )
  183.      (if (exists "Prefs/ClassAct") ; The archive contains ClassAct prefs tools
  184.      (
  185.           (message #caprefs-message)
  186.  
  187.           (copylib (source "Prefs/CAPrefs")
  188.                (dest "C:")
  189.                (prompt (cat #installing "CAPrefs"))
  190.           )
  191.           (copylib (source "Prefs/ClassAct")
  192.                (dest "SYS:Prefs")
  193.                (prompt (cat #installing "ClassAct Prefs"))
  194.                (infos)
  195.           )
  196.  
  197.           (complete comp-prefs)
  198.  
  199.           (if (not (exists "ENVARC:ClassAct" (noreq)))
  200.                (
  201.                     (makedir "ENVARC:ClassAct"
  202.                          (prompt (cat #creating-dir "ENVARC:ClassAct"))
  203.                     )
  204.                     (textfile (dest "ENVARC:ClassAct/ClassAct")
  205.                          (append "")
  206.                     )
  207.                )
  208.           )
  209.  
  210.           (set caprefs-cmd "C:CAPrefs >NIL:\n")
  211.  
  212.           (startup "CAPREFS"
  213.                (prompt (cat #caprefs-startup-1 caprefs-cmd #caprefs-startup-2))
  214.                (help #caprefs-message)
  215.                (command caprefs-cmd)
  216.           )
  217.      )
  218.      )
  219.  
  220.      (complete classact-complete)
  221. )
  222.  
  223. ; ************** END OF CLASSACT INSTALL PROCEDURE. COPY THE BLOCK ABOVE
  224. ; ************** TO YOUR CLASSACT APPLICATION INSTALLER.
  225.  
  226. ; ---------------------------------------------------------------------------
  227.  
  228. (complete 0)
  229.  
  230. ; determine cpu type
  231. (set cpu (database "cpu"))
  232.  
  233. (set defcpu
  234.      (if (OR (= cpu "68000") (= cpu "68010"))
  235.           (set defcpu 0)
  236.           (set defcpu 1)
  237.      )
  238. )
  239.  
  240. (set @default-dest
  241.      (askdir
  242.           (prompt "In which directory would you like Ax installed? (A directory will be created there.)")
  243.           (help @askdir-help)
  244.           (default @default-dest)
  245.      )
  246. )
  247.  
  248. (set maindir (tackon @default-dest "Ax"))
  249.  
  250. (set axver
  251.      (askchoice
  252.           (prompt "Which executable type of Ax would you like installed?")
  253.           (help @askchoice-help)
  254.           (choices "68000" "68020+")
  255.           (default defcpu)
  256.      )
  257. )
  258.  
  259. (set rexxdir
  260.      (askdir
  261.           (prompt "In which directory would you like Ax's ARexx scripts installed?")
  262.           (help @askdir-help)
  263.           (default (tackon maindir "Rexx"))
  264.           (newpath)
  265.      )
  266. )
  267.  
  268. (set helpdir
  269.      (askdir
  270.           (prompt "In which directory would you like Ax's AmigaGuide documentation installed?")
  271.           (help @askdir-help)
  272.           (default maindir)
  273.           (newpath)
  274.      )
  275. )
  276.  
  277. (select axver
  278.      (copyfiles
  279.           (prompt "Copying main executable (Ax)...")
  280.           (help @copyfiles-help)
  281.           (source "Ax")
  282.           (dest maindir)
  283.           (infos)
  284.           (optional "nofail")
  285.      )
  286.  
  287.      (copyfiles
  288.           (prompt "Copying main executable (Ax020)...")
  289.           (help @copyfiles-help)
  290.           (source "Ax020")
  291.           (dest maindir)
  292.           (infos)
  293.           (newname "Ax")
  294.           (optional "nofail")
  295.      )
  296. )
  297.  
  298. (copyfiles
  299.      (prompt "Copying UpdateDB utility...")
  300.      (help @copyfiles-help)
  301.      (source "UpdateDB")
  302.      (dest maindir)
  303.      (optional "nofail")
  304. )
  305.  
  306. (complete 25)
  307.  
  308. (copyfiles
  309.      (prompt "Copying AmigaGuide documentation...")
  310.      (help @copyfiles-help)
  311.      (source "Docs/Ax.guide")
  312.      (dest helpdir)
  313.      (infos)
  314.      (optional "nofail")
  315. )
  316.  
  317. ; .guide file uses AmigaGuide instead of MultiView for OS <= V38
  318. (set ver (/ (getversion) 65536))
  319.  
  320. (if (<= ver 38)
  321.      (tooltype
  322.           (dest (tackon helpdir "Ax.guide"))
  323.           (setdefaulttool "AmigaGuide")
  324.      )
  325. )
  326.  
  327. (complete 30)
  328.  
  329. (copyfiles
  330.      (prompt "Copying ARexx scripts...")
  331.      (help @copyfiles-help)
  332.      (source "Rexx")
  333.      (dest rexxdir)
  334.      (confirm)
  335.      (pattern "#?.ax")
  336.      (infos)
  337.      (optional "nofail")
  338. )
  339.  
  340. (complete 50)
  341.  
  342. (install-classact)
  343.  
  344. (complete 100)
  345.  
  346. (exit)
  347.  
  348.